<%--
  Created by IntelliJ IDEA.
  User: 123
  Date: 2020/11/11
  Time: 21:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <link href="css/common.css" rel="stylesheet" type="text/css" />
    <link href="css/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="wrap">
    <!-- main begin-->
    <div class="main">
        <div class="sidebar">
            <p><img src="images/img1.jpg" width="443" height="314" alt="" /></p>
        </div>
        <div class="sidebarg">
            <form action="${pageContext.request.contextPath}/register.jsp" method="post" target='_blank'>
                <div class="login">
                    <dl>
                        <dt class="blues">用户登陆</dt>
                        <dd><label for="name">用户名：</label><input type="text" class="inputh" value="常用邮箱" id="name"/></dd>
                        <dd><label for="password">密 码：</label><input type="text" class="inputh" value="密码" id="password"/></dd>
                        <dd>
                            <label class="lf" for="passwords">验证码：</label>
                            <input type="text" class="inputh inputs lf" value="验证码" id="passwords"/>
                            <span class="wordp lf"><img src="${pageContext.request.contextPath}/function/function_yazheng" width="96" height="27" alt="" /></span>
                            <span class="blues lf"><a href="" title="">看不清</a></span>
                        </dd>
                        <dd>
                            <input name=""  type="checkbox" id="rem_u"  />
                            <span for="rem_u">下次自动登录</span>
                        </dd>
                        <dd class="buttom">

                            <button type="button" onclick="doAjax()" class="spbg buttombg f14 lf">登录</button>
                            <input name="" type="submit" value="注 册" class="spbg buttombg f14 lf" />
                            <span class="blues  lf"><a href="" title="">忘记密码?</a></span>
                            <div class="cl"></div>
                        </dd>

                    </dl>
                </div>
            </form>
        </div>
        <div class="cl"></div>
    </div>
    <!-- main end-->

    <!-- footer begin-->
</div>
<!--footer end-->

</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.11.1.js"></script>
<script type="text/javascript">
    function doAjax() {
        var names=$("#name").val()
        console.log(names)
        var passwords=$("#password").val()
        var yanzheng=$("#passwords").val()
        $.ajax({
            url:"${pageContext.request.contextPath}/function/function_login",
            type:"post",
            data:"name="+names+"&pwd="+passwords+"&yanzheng="+yanzheng+"",
            success:function (date) {
                if (date=="true"){
                    location="jingpai.jsp"
                }else{
                    location="${pageContext.request.contextPath}/login.jsp"
                }
            }
        })
    }
</script>
</body>
</html>

